package uvprocess;

public class UVProcessProxy implements uvprocess.UVProcess {
  private String _endpoint = null;
  private uvprocess.UVProcess uVProcess = null;
  
  public UVProcessProxy() {
    _initUVProcessProxy();
  }
  
  public UVProcessProxy(String endpoint) {
    _endpoint = endpoint;
    _initUVProcessProxy();
  }
  
  private void _initUVProcessProxy() {
    try {
      uVProcess = (new uvprocess.UserServiceLocator()).getUserServicePort();
      if (uVProcess != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)uVProcess)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)uVProcess)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (uVProcess != null)
      ((javax.xml.rpc.Stub)uVProcess)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public uvprocess.UVProcess getUVProcess() {
    if (uVProcess == null)
      _initUVProcessProxy();
    return uVProcess;
  }
  
  public java.lang.String addUV(java.lang.String name, java.lang.String description, int year, int cm, int td, int tp, int be, int controle, java.lang.String inCharge, java.lang.String login, java.lang.String password) throws java.rmi.RemoteException{
    if (uVProcess == null)
      _initUVProcessProxy();
    return uVProcess.addUV(name, description, year, cm, td, tp, be, controle, inCharge, login, password);
  }
  
  
}